import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教师信息信息 */
export interface Teacher {
          teacherId: number; // 教师唯一ID
          teacherName?: string; // 教师姓名
          subject: string; // 主要授课科目（可选）
  }

// 教师信息 API
export const TeacherApi = {
  // 查询教师信息分页
  getTeacherPage: async (params: any) => {
    return await request.get({ url: `/ao/teacher/page`, params })
  },

  // 查询教师信息详情
  getTeacher: async (id: number) => {
    return await request.get({ url: `/ao/teacher/get?id=` + id })
  },

  // 新增教师信息
  createTeacher: async (data: Teacher) => {
    return await request.post({ url: `/ao/teacher/create`, data })
  },

  // 修改教师信息
  updateTeacher: async (data: Teacher) => {
    return await request.put({ url: `/ao/teacher/update`, data })
  },

  // 删除教师信息
  deleteTeacher: async (id: number) => {
    return await request.delete({ url: `/ao/teacher/delete?id=` + id })
  },

  /** 批量删除教师信息 */
  deleteTeacherList: async (ids: number[]) => {
    return await request.delete({ url: `/ao/teacher/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教师信息 Excel
  exportTeacher: async (params) => {
    return await request.download({ url: `/ao/teacher/export-excel`, params })
  },
}